fix(tasks): accept 'none' as valid recurrence value#29
Merged
xierongchuan merged 1 commit intoxierongchuan:mainfrom Nov 14, 2025
Merged
fix(tasks): accept 'none' as valid recurrence value#29xierongchuan merged 1 commit intoxierongchuan:mainfrom
xierongchuan merged 1 commit intoxierongchuan:mainfrom
Conversation
Problem: When creating a non-recurring task (recurrence: "none") from the frontend, the API returned validation errors: - "The selected recurrence is invalid." - "The recurrence time field must match the format H:i:s." This happened because the validation only accepted 'daily', 'weekly', and 'monthly' values, but the frontend sends 'none' for non-recurring tasks. Solution: 1. Updated TaskController validation to accept 'none' in recurrence enum 2. Modified custom validation logic to skip checks when recurrence is 'none' 3. Updated swagger.yaml to document 'none' as a valid recurrence option Changes: - TaskController.php:211,299 - Added 'none' to recurrence validation enum - TaskController.php:223,313 - Skip validation when recurrence is 'none' - swagger.yaml:248,2389,2540 - Added 'none' to recurrence enum in all schemas Related to: xierongchuan/TaskMateClient#54 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Проблема
При создании единовременной задачи (recurrence: "none") из фронтенда TaskMateFrontend, API возвращал ошибки валидации:
Это происходило потому, что валидация принимала только значения 'daily', 'weekly' и 'monthly', но фронтенд отправляет 'none' для задач без повторения.
🔧 Решение
1. Обновлена валидация в TaskController (app/Http/Controllers/Api/V1/TaskController.php)
Строки 211, 299: Добавлено 'none' в enum валидации
Строки 223, 313: Пропуск дополнительной валидации для 'none'
2. Обновлена swagger документация (swagger.yaml)
Строки 248, 2389, 2540: Добавлено 'none' в enum во всех схемах
📋 Изменения
TaskController.php
swagger.yaml
🧪 Тестирование
До исправления:
После исправления:
🔗 Связанные задачи
✅ Результат
Теперь API корректно принимает 'none' для единовременных задач, что соответствует ожиданиям фронтенда.
🤖 Generated with Claude Code
Summary by cubic
Accept 'none' as a valid recurrence for one-off tasks to prevent 422 validation errors. Skip recurrence-specific checks when 'none' is used and document the value in Swagger.
Written for commit df1562a. Summary will update automatically on new commits.